import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';

class ClipboardUtil {
  //复制内容
  static setData(String data) {
    if (data != '') {
      Clipboard.setData(ClipboardData(text: data));
    }
  }

  //复制内容
  static setDataToast(String data) {
    if (data != '') {
      Clipboard.setData(ClipboardData(text: data));
      EasyLoading.showToast("复制成功");
    } else {
      EasyLoading.showToast('复制的内容不存在');
    }
  }

  //复制内容
  static setDataToastMsg(String data, {String toastMsg = '复制成功'}) {
    if (data != '') {
      Clipboard.setData(ClipboardData(text: data));
      EasyLoading.showToast("复制成功");
    }
  }
}
